<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Jumper documentation</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Jumper</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Class_Node_">Class Node </a></li>
</ul>


<h2>Modules</h2>
<ul>
  <li><a href="../modules/core.bheap.html">core.bheap</a></li>
  <li><a href="../modules/core.heuristics.html">core.heuristics</a></li>
  <li><strong>core.node</strong></li>
  <li><a href="../modules/core.path.html">core.path</a></li>
  <li><a href="../modules/grid.html">grid</a></li>
  <li><a href="../modules/pathfinder.html">pathfinder</a></li>
</ul>
<h2>Examples</h2>
<ul>
  <li><a href="../examples/annotatedpathing.lua.html">annotatedpathing.lua</a></li>
  <li><a href="../examples/customheuristics.lua.html">customheuristics.lua</a></li>
  <li><a href="../examples/makeclearance.lua.html">makeclearance.lua</a></li>
  <li><a href="../examples/simpleexample.lua.html">simpleexample.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>core.node</code></h1>

<p>The Node class.</p>
<p> The <a href="../modules/core.node.html">node</a>  represents a cell (or a tile) on a collision map. Basically, for each single cell (tile)
 in the collision map passed-in upon initialization, a <a href="../modules/core.node.html">node</a>  object will be generated
 and then cached within the <a href="../modules/grid.html#">grid</a> .</p>

<p> In the following implementation, nodes can be compared using the <code>&lt;</code> operator. The comparison is
 made with regards of their <code>f</code> cost. From a given node being examined, the <a href="../modules/pathfinder.html#">pathfinder</a>  will expand the search
 to the next neighbouring node having the lowest <code>f</code> cost. See <a href="../modules/core.bheap.html#">core.bheap</a>  for more details.
 </p>

<h2><a href="#Class_Node_">Class Node </a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Node:new">Node:new&nbsp;(x, y)</a></td>
	<td class="summary">Inits a new <a href="../modules/core.node.html">node</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Node:getX">Node:getX&nbsp;()</a></td>
	<td class="summary">Returns x-coordinate of a <a href="../modules/core.node.html">node</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Node:getY">Node:getY&nbsp;()</a></td>
	<td class="summary">Returns y-coordinate of a <a href="../modules/core.node.html">node</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Node:getPos">Node:getPos&nbsp;()</a></td>
	<td class="summary">Returns x and y coordinates of a <a href="../modules/core.node.html">node</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Node:getClearance">Node:getClearance&nbsp;(walkable)</a></td>
	<td class="summary">Returns the amount of true <a href="http://aigamedev.com/open/tutorial/clearance-based-pathfinding/#TheTrueClearanceMetric">clearance</a>
 for a given <a href="../modules/core.node.html">node</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Node:removeClearance">Node:removeClearance&nbsp;(walkable)</a></td>
	<td class="summary">Removes the clearance value for a given walkable.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Node:reset">Node:reset&nbsp;()</a></td>
	<td class="summary">Clears temporary cached attributes of a <a href="../modules/core.node.html">node</a> .</td>
	</tr>
</table>

<br/>
<br/>


    <h2><a name="Class_Node_"></a>Class Node </h2>
    The <a href="../modules/core.node.html#Class_Node">Node</a>  class.<br/>
 This class is callable.
 Therefore,_ <code>Node(...)</code> <em>acts as a shortcut to</em> <code>Node:new(...)</code>.
    <dl class="function">
    <dt>
    <a name = "Node:new"></a>
    <strong>Node:new&nbsp;(x, y)</strong>
    </dt>
    <dd>
    Inits a new <a href="../modules/core.node.html">node</a>

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">x</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the x-coordinate of the node on the collision map</li>
      <li><span class="parameter">y</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the y-coordinate of the node on the collision map</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">local node = Node(3,4)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.node.html">node</a></span>
        a new <a href="../modules/core.node.html">node</a>
    </ol>


</dd>
    <dt>
    <a name = "Node:getX"></a>
    <strong>Node:getX&nbsp;()</strong>
    </dt>
    <dd>
    Returns x-coordinate of a <a href="../modules/core.node.html">node</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local x = node:getX()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">number</span></span>
        the x-coordinate of the <a href="../modules/core.node.html">node</a>
    </ol>


</dd>
    <dt>
    <a name = "Node:getY"></a>
    <strong>Node:getY&nbsp;()</strong>
    </dt>
    <dd>
    Returns y-coordinate of a <a href="../modules/core.node.html">node</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local y = node:getY()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">number</span></span>
        the y-coordinate of the <a href="../modules/core.node.html">node</a>
    </ol>


</dd>
    <dt>
    <a name = "Node:getPos"></a>
    <strong>Node:getPos&nbsp;()</strong>
    </dt>
    <dd>
    Returns x and y coordinates of a <a href="../modules/core.node.html">node</a>


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local x, y = node:getPos()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
          <span class="types"><span class="type">number</span></span>
        the x-coordinate of the <a href="../modules/core.node.html">node</a> </li>
        <li>
          <span class="types"><span class="type">number</span></span>
        the y-coordinate of the <a href="../modules/core.node.html">node</a> </li>
    </ol>


</dd>
    <dt>
    <a name = "Node:getClearance"></a>
    <strong>Node:getClearance&nbsp;(walkable)</strong>
    </dt>
    <dd>
    Returns the amount of true <a href="http://aigamedev.com/open/tutorial/clearance-based-pathfinding/#TheTrueClearanceMetric">clearance</a>
 for a given <a href="../modules/core.node.html">node</a>

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">walkable</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       the value for walkable locations in the collision map array.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
  -- Assuming walkable was 0
 local clearance = node:getClearance(0)		</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the clearance of the <a href="../modules/core.node.html">node</a>
    </ol>


</dd>
    <dt>
    <a name = "Node:removeClearance"></a>
    <strong>Node:removeClearance&nbsp;(walkable)</strong>
    </dt>
    <dd>
    Removes the clearance value for a given walkable.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">walkable</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       the value for walkable locations in the collision map array.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
  -- Assuming walkable is defined
 node:removeClearance(walkable)	</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.node.html">node</a></span>
        self (the calling <a href="../modules/core.node.html">node</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Node:reset"></a>
    <strong>Node:reset&nbsp;()</strong>
    </dt>
    <dd>
    Clears temporary cached attributes of a <a href="../modules/core.node.html">node</a> .
 Deletes the attributes cached within a given node after a pathfinding call.
 This function is internally used by the search algorithms, so you should not use it explicitely.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local thisNode = Node(1,2)
 thisNode:reset()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/core.node.html">node</a></span>
        self (the calling <a href="../modules/core.node.html">node</a>  itself, can be chained)
    </ol>


</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
